Repository navigation
fix(store): compare editor process names exactly, never as substrings of the joined listing (#99) - #101
Merged
Conversation
… of the joined listing (#99)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #99.
editorProcesses()substring-matched the joined process listing, so npm's rewritten process title (npm exec capcut-cli@0.21.0 …) made the CLI detect itself as a running editor and refuse every mutating command on the documented zero-install path, with CapCut closed.Change (
src/store.ts): the raw listing is parsed per line by a new pure helper,matchEditorProcesses(listing, flavor), and compared exactly, case-insensitively:ps -axo comm=line — not whole-line equality, because macOS prints the executable's full bundle path there (/Applications/CapCut.app/Contents/MacOS/CapCut), and the existing fake-editor test spawns by absolute path and relies on it.tasklist /FO CSVimage name (first quoted field). Same substring shape as the posix branch; it couldn't false-positive under npx (image name isnode.exe) but matched any image name merely containingcapcut.exe.Tests (
test/editor-processes.test.mjs): the reporter's fixture as written — a listing whose onlycapcutis thenpm exec capcut-cli@0.21.0 …title returns[]— plus the macOS bundle path still detecting, bare Linux comm names, contains-but-not-equals names (MyCapCut,capcut-sync,CapCut Helper (Renderer)), the win32 CSV row, and empty listings. The live guard test insync-timelines.test.mjs(realps, fakeCapCutbinary) still passes unchanged.Full suite: 852/852, biome clean. Docs: changelog entry, README release notes rotated in both languages, version 0.21.1.